<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录界面</title>
<link rel="stylesheet" 
		href="${pageContext.request.contextPath}/themes/icon.css">
<link rel="stylesheet" 
		href="${pageContext.request.contextPath}/themes/bootstrap/easyui.css">
<script type="text/javascript" 
		src="${pageContext.request.contextPath}/js/jquery.js"></script>
<script type="text/javascript" 
		src="${pageContext.request.contextPath}/js/jquery.easyui.min.js"></script>
<script type="text/javascript" 
		src="${pageContext.request.contextPath}/js/easyui-lang-zh_CN.js"></script>
</head>
<script type="text/javascript">
	$(function () {
		$('#loginWindow').window({   
			title:'登录',
			shadow:true,
		    width:600,    
		    height:400,    
		    modal:true   
		}); 
		$('#userName').textbox({    
		    height:40,
		    iconCls:'icon-man', 
		    iconAlign:'left',
		    prompt:'请输入用户名'
		    
		})
		$('#userPasswd').textbox({ 
			height:40,
		    iconCls:'icon-lock', 
		    iconAlign:'left',
		    prompt:'请输入密码'
		})
		$('#login').linkbutton({    
		    iconCls: 'icon-ok',
		}); 
		 $('#login').bind('click', function(){    
		    $('#loginForm').submit();       
		});
		 $('#loginForm').form({    
			    url:"login",    
			    success:function(data){  
			    	var data = eval('('+data+')');
			        if (data.success) {
						location.href="main.jsp";
					}else {
						location.href="login.jsp";
					}    
			    }    
			});
		
	})
</script>
<body>
	<div id="loginWindow">
		<div style="margin-left: 150px;margin-top: 100px;">
		<form id="loginForm" method="post">   
    		<input id="userName" name="userName" type="text" style="width:300px ">
    		<br>
    		<br>
    		<input id="userPasswd" name="userPassWd" type="password" style="width:300px">
		</form> 
			<br>
	   		
		<a id="login" href="#">登录</a>
		</div>
	</div>  
</body>
</html>